import axiosInstance from '@/api/axiosInstance'
interface specifyServiceListParams {
  name?: string
  // 其他查詢條件...
}

// 獲取指定服務列表
export const getSpecifyServiceList = async (params?: specifyServiceListParams) => {
  return axiosInstance.get('/admin/specify-service', { params })
}

export const createSpecifyService = async (data: any) => {
  return axiosInstance.post(`/admin/specify-service`, data)
}

// 更新指定服務
export const updateSpecifyService = async (id: number, data: any) => {
  return axiosInstance.put(`/admin/specify-service/${id}`, data)
}

export const deleteSpecifyService = async (id: number) => {
  return axiosInstance.delete(`/admin/specify-service/${id}`)
}


// 創建指定服務子項
export const createSpecifyServiceItem = async (data: any,type:number) => {
  return axiosInstance.post(`/admin/specify-service/${type}/item`, data)
}

// 更新指定服務子項
export const updateSpecifyServiceItem = async (id: number, type:number, data: any) => {
  return axiosInstance.put(`/admin/specify-service/${type}/item/${id}`, data)
}

// 刪除指定服務子項
export const deleteSpecifyServiceItem = async (id: number,type:number) => {
  return axiosInstance.delete(`/admin/specify-service/${type}/item/${id}`)
}

// 導出
export const exportSpecifyServiceList = async () => {
  return axiosInstance.get('/admin/specify-service/export', { responseType: 'blob', timeout: 60000 })
}



